import { _decorator, Component, KeyCode, Node, PhysicsSystem2D, Vec2 } from 'cc';
import { InputManager } from '../../Base/InputManager';
import { ENTITY_STATE_ENUM, PARAMS_NAME_ENUM } from '../../Enum';
import { playerState } from './playerState';
import { GroundState } from './GroundState';
const { ccclass, property } = _decorator;

@ccclass('IdleState')
export class IdleState extends GroundState {
    onEnter(): void {
        super.onEnter();
    }
    update(deltaTime: number): void {
        super.update(deltaTime);
        if (InputManager.Instance.moveDir.x !== 0 && this.fsm.lastOnGroundTime > 0) {
            this.fsm.transit(ENTITY_STATE_ENUM.RUN)
        }
    }
    onExit(): void {
        super.onExit();
    }
    canTransit(to: ENTITY_STATE_ENUM): boolean {
        return super.canTransit(to);
    }
}


